Oozie快速启动

这些说明安装和运行Oozie使用内置Tomcat服务器和Derby数据库.详细信息参见Oozie安装 1. 编译Oozie 2. 服务器安装 3. 客户端安装 4. Oozie共享库安装

1. 编译Oozie

条件:

Unix box (tested on Mac OS X and Linux)
Java JDK 1.6+
Maven 3.0.1+
Hadoop 0.20.2+
Pig 0.7+

JDK commands (java, javac) must be in the command path. The Maven command (mvn) must be in the command path.

编译 Oozie

下载Releases版,解压 tar.gz到目录,编译 运行 mkdistro.sh 脚本:

$ bin/mkdistro.sh

跳过测试:

$ bin/mkdistro.sh -DskipTests

运行 mkdistro.sh 可以创建二进制Oozie.

IMPORTANT: 默认编译适用Hadoop 1.1.1.编译使用Hadoop 2.x版,推荐使用Bigtop 版如果使用Hadoop 2.x由于Oozie共享库从tarball编译不适用.详细参见 Building Oozie page.

2. 服务器安装

条件:

Unix (tested in Linux and Mac OS X)
Java 1.6+
Hadoop
    Apache Hadoop (tested with 1.0.0 & 0.23.1)
ExtJS library (optional, to enable Oozie webconsole)
    ExtJS 2.2

The Java 1.6+ bin directory should be in the command path.

Server 安装

IMPORTANT: Oozie忽略任何OOZIE_HOME设置, Oozie自动计算home.

编译 Oozie binary distribution
下载 a Hadoop binary distribution
下载 ExtJS library (it must be version 2.2)

NOTE: The ExtJS library 与Oozie不绑定.推荐使用Oozie Unix user 用于Oozie server. 解压tar.gz .

NOTE: 配置Hadoop集群使用proxyuser用于Oozie进程.

设置Hadoop配置文件core-site.xml:(替换大写字母)

<!-- OOZIE -->
<property>
    <name>hadoop.proxyuser.[OOZIE_SERVER_USER].hosts</name>
    <value>[OOZIE_SERVER_HOSTNAME]</value>
</property>
<property>
    <name>hadoop.proxyuser.[OOZIE_SERVER_USER].groups</name>
    <value>[USER_GROUPS_THAT_ALLOW_IMPERSONATION]</value>
</property>

IMPORTANT:所有服务器脚本 (=oozie-setup.sh=, oozied.sh, oozie-start.sh , oozie-run.sh 和 oozie-stop.sh ) 仅在Unix用户下运行,调用脚本时使用sudo -u OOZIE_USER.

Oozie版本3.3.2, oozie-start.sh , oozie-run.sh , and oozie-stop.sh 脚本已经不推荐.使用oozied.sh代替 ; 提交start , run , or stop作为参数运行相应oozie-start.sh , oozie-run.sh , and oozie-stop.sh 行为.

Oozie解压目录下创建目录 libext/.

使用相应版本库,从hadooplibs/复制Hadoop JARs到libext/目录.使用不同版本hadoop,复制这个Hadoop必须的JARs 到libext/目录. 使用ExtJS 库,复制zip文件到libext/

命令"sharelib create -fs fs_default_name [-locallib sharelib]" 在运行oozie-setup.sh用于上传新sharelib 到hdfs有效,第一个参数是默认fs名称,第二参数是Oozie安装的共享库, it can be a tarball or the expanded version of it. If the second argument is omitted, the Oozie sharelib tarball from the Oozie installation directory will be used. Upgrade command is deprecated, one should use create command to create new version of sharelib. Sharelib files are copied to new lib_ directory. At start, server picks the sharelib from latest time-stamp directory. While starting server also purge sharelib directory which is older than sharelib retention days (defined as oozie.service.ShareLibService.temp.sharelib.retention.days and 7 days is default). "prepare-war [-d directory]" 命令用来创建war 文件 for oozie with an optional alternative directory other than libext.

db create|upgrade|postupgrade -run [-sqlfile ] command is for create, upgrade or postupgrade oozie db with an optional sql file

运行脚本 oozie-setup.sh 配置Oozie所有添加的组件到libext/目录.

$ bin/oozie-setup.sh prepare-war [-d directory] [-secure]
         sharelib create -fs <FS_URI> [-locallib <PATH>]
         sharelib upgrade -fs <FS_URI> [-locallib <PATH>]
         db create|upgrade|postupgrade -run [-sqlfile <FILE>]

选项-secure将配置Oozie 使用HTTP (SSL); 参考更多信息Setting Up Oozie with HTTPS (SSL).

使用 'ooziedb.sh'命令行工具创建 Oozie DB:

$ bin/ooziedb.sh create -sqlfile oozie.sql -runValidate DB Connection.
    DONE
    Check DB schema does not exist
    DONE
    Check OOZIE_SYS table does not exist
    DONE
    Create SQL schema
    DONE
    DONE
    Create OOZIE_SYS table
    DONE
    Oozie DB has been created for Oozie version '3.2.0'

启动Oozie守护进程:

$ bin/oozied.sh start

启动Oozie前台进程:

$ bin/oozied.sh run

检查日志文件确保正确启动logs/oozie.log .

检查Oozie状态:

$ bin/oozie admin -oozie http://localhost:11000/oozie -status

流量Web控制台 Oozie web console , Oozie 状态为 NORMAL .

运行案例 Examples documentfor details on running the examples.

3. 客户端安装

Requirements

Unix (tested in Linux and Mac OS X)
Java 1.6+

复制解压oozie-client TAR.GZ文件.添加 bin/ 目录到PATH .

参考the Command Line Interface Utilities document Oozie命令行工具. NOTE:Oozie server安装包括Oozie client.Oozie client应该只安装到远程机器.

4. Oozie Share Lib Installation

解压 oozie-sharelib TAR.GZ 文件,复制目录 share/ 到HDFS的Oozie HOME目录:

$ hadoop fs -put share share

IMPORTANT: 使用Oozie Hadoop (HDFS)用户.如果目录已经存在,则需先删除再复制. 更多共享库信息参见 Workflow Functional Specification .